import request from "@/utils/request";
import { ParseData } from "@/utils/utils";

//获取项目列表分页
export const GetProjectList = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu?${ParseData(data)}`,
  });
};
//新建项目
export const AddProject = (data: any) => {
  return request({
    method: "POST",
    url: `/xiangmu`,
    data,
  });
};
// 项目审核
export const ReviewProject = (data: any) => {
  return request({
    method: "PUT",
    url: `/xiangmu/shenhe`,
    data,
  });
};
//编辑项目
export const EditProject = (data: any) => {
  return request({
    method: "PUT",
    url: `/xiangmu`,
    data,
  });
};
//项目编辑查看
export const GetEditProject = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/${data.id}`,
  });
};
//项目详情查看
export const GetProject = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xiangqing/${data.id}`,
  });
};
//项目详情查看
export const NoteProject = (data: any) => {
  return request({
    method: "PUT",
    url: `/xiangmu/beizhu`,
    data,
  });
};
//项目删除
export const DeleteProject = (data: any) => {
  return request({
    method: "DELETE",
    url: `/xiangmu/${data.id}`,
  });
};
//获取项目类型下拉
export const GetProjectType = (data?: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xuanze?${ParseData(data)}`,
  });
};
// 项目详情-人员管理列表
export const GetProjectPeople = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xiangqing/renyuan?${ParseData(data)}`,
  });
};
// 项目详情-选择人员管理列表
export const GetProjectPeopleList = (data: any) => {
  return request({
    method: "GET",
    url: `/zhuanjia/xuanze?${ParseData(data)}`,
  });
};
// 项目详情-人员--添加负责人
export const AddProjectPrincipal = (data: any) => {
  return request({
    method: "POST",
    url: `/xiangmu/xiangqing/renyuan`,
    data,
  });
};
// 项目详情-人员--删除负责人
export const DeleteProjectPrincipal = (data: any) => {
  return request({
    method: "DELETE",
    url: `/xiangmu/xiangqing/renyuan/${data.id}`,
  });
};
// 项目详情-专家留言板列表
export const GetProjectExpertCommentList = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xiangqing/liuyanban?${ParseData(data)}`,
  });
};
// 项目详情-专家留言板--置顶
export const ProjectExpertAddTop = (data: any) => {
  return request({
    method: "PUT",
    url: `/xiangmu/xiangqing/liuyanban/zhiding/${data.id}`,
  });
};
// 项目详情-专家留言板--加V
export const ProjectExpertAddV = (data: any) => {
  return request({
    method: "PUT",
    url: `/xiangmu/xiangqing/liuyanban/renzhengjiav/${data.id}`,
  });
};
// 项目详情-参与供应商列表
export const GetProjectSupplierList = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xiangqing/gongyingshang?${ParseData(data)}`,
  });
};
// 项目详情-参与供应商选择
export const GetProvider = (data: any) => {
  return request({
    method: "GET",
    url: `/gongyingshang/xuanze?${ParseData(data)}`,
  });
};
// 项目详情-删除参与供应商
export const DeleteProjectSupplier = (data: any) => {
  return request({
    method: "DELETE",
    url: `/xiangmu/xiangqing/gongyingshang/${data.id}`,
  });
};
// 项目详情-添加参与供应商
export const AddProjectSupplier = (data: any) => {
  return request({
    method: "POST",
    url: `/xiangmu/xiangqing/gongyingshang`,
    data,
  });
};
// 项目详情-项目使用产品列表
export const GetProjectProductList = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xiangqing/chanpin?${ParseData(data)}`,
  });
};
// 项目详情-添加项目使用产品
export const AddProjectProduct = (data: any) => {
  return request({
    method: "POST",
    url: `/xiangmu/xiangqing/chanpin`,
    data,
  });
};
// 项目详情-删除项目使用产品
export const DeleteProjectProduct = (data: any) => {
  return request({
    method: "DELETE",
    url: `/xiangmu/xiangqing/chanpin/${data.id}`,
  });
};
// 项目详情-入驻品牌列表
export const GetProjectBrandList = (data: any) => {
  return request({
    method: "GET",
    url: `/xiangmu/xiangqing/ruzhupinpai?${ParseData(data)}`,
  });
};
// 项目详情-删除项目入驻品牌
export const DeleteProjectBrand = (data: any) => {
  return request({
    method: "DELETE",
    url: `/xiangmu/xiangqing/ruzhupinpai/${data.id}`,
  });
};
// 项目详情-添加品牌
export const AddProjectBrand = (data: any) => {
  return request({
    method: "POST",
    url: `/xiangmu/xiangqing/ruzhupinpai`,
    data,
  });
};
// 项目文件导入
export const ProjectUpload = (data: any) => {
  return request({
    method: "POST",
    url: `/xiangmu/daoru`,
    data,
  });
};
